#pragma once

#include <iostream>
#include <thread>
#include "util.hpp"

namespace bitlog
{
    using namespace util;
    class LogMsg
    {
    public:
        time_t _time;          // 时间
        LogLevel::lev _level;  // 等级
        std::string _filename; // 文件名
        int _line;             // 行号
        std::thread::id _tid;  // 线程id
        std::string _logger;   // 日志器名称
        std::string _msg;      // 有效消息

        LogMsg(LogLevel::lev level, std::string filename, int line, std::string logger, std::string msg)
            : _time(Date::getTime()), _level(level), _filename(filename), _line(line),
              _tid(std::this_thread::get_id()), _logger(logger), _msg(msg)
        {
        }
    };
}